<p>This module has two directives. The <code class="directive"><a href="#action">Action</a></code> directive lets you run CGI
scripts whenever a file of a certain <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a> is requested. The
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The <code>virtual</code> modifier and handler passing were
introduced in Apache 2.1</td></tr>
</table>
<p>This directive adds an action, which will activate
<var>cgi-script</var> when <var>action-type</var> is triggered by
the request. The <var>cgi-script</var> is the URL-path to a
resource that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>. The
<var>action-type</var> can be either a <a href="../handler.html">handler</a> or a <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME content type</a>. It sends the URL and
file path of the requested document using the standard CGI
<code>PATH_INFO</code> and <code>PATH_TRANSLATED</code>
environment variables. The handler used for the particular request
is passed using the <code>REDIRECT_HANDLER</code> variable.</p>
<div class="example"><h3>Examples</h3><p><code>
# Requests for files of a particular MIME content type:<br />
Action image/gif /cgi-bin/images.cgi<br />
<br />
# Files of a particular file extension<br />
AddHandler my-file-type .xyz<br />
Action my-file-type /cgi-bin/program.cgi<br />
</code></p></div>
<p>In the first example, requests for files with a MIME content
type of <code>image/gif</code> will be handled by the
<p>This directive adds an action, which will activate
<var>cgi-script</var> when a file is requested using the method of
<var>method</var>. The <var>cgi-script</var> is the URL-path to a
resource that has been designated as a CGI script using <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code>. The URL and
file path of the requested document is sent using the standard CGI
<code>PATH_INFO</code> and <code>PATH_TRANSLATED</code> environment
variables.</p>
<div class="note">
Any arbitrary method name may be used. <strong>Method names are
case-sensitive</strong>, so <code>Script PUT</code> and
<code>Script put</code> have two entirely different
effects.
</div>
<p>Note that the <code class="directive">Script</code> command defines default
actions only. If a CGI script is called, or some other resource that is
capable of handling the requested method internally, it will do
so. Also note that <code class="directive">Script</code> with a method of
<code>GET</code> will only be called if there are query arguments present
(<em>e.g.</em>, foo.html?hi). Otherwise, the request will
proceed normally.</p>
<div class="example"><h3>Examples</h3><p><code>
# For <ISINDEX>-style searching<br />
Script GET /cgi-bin/search<br />
<br />
# A CGI PUT handler<br />
Script PUT /~bob/put.cgi<br />
</code></p></div>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../de/mod/mod_actions.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
<a href="../en/mod/mod_actions.html" title="English"> en </a> |
<a href="../ja/mod/mod_actions.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/mod/mod_actions.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>